﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using ZuesControls.Models;

namespace ZuesControls.Converters
{
    public class LevelToLineInfoListConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is int level && level > 0)
            {
                return Enumerable.Range(1, level)
                                 .Select(i => new LineInfo { Level = i })
                                 .ToList();
            }
            return Enumerable.Empty<LineInfo>();
        }


        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
